package cn.com.nes.site.controller.monitor.vo;

import cn.com.nes.site.service.monitor.bo.EquipmentBO;
import cn.hutool.core.util.StrUtil;
import lombok.Data;

@Data
public class QueryEquipmentVO {

    /**
     * 传输序列号
     */
    private String dtuId;

    /**
     * 传输序列号查询方式： like-模糊查询，eq-精准查询
     */
    private String dtuQueryType;

    /**
     * 设备ID
     */
    private String equipmentId;

    /**
     * 设备厂家ID
     */
    private String manufacturerId;


    public EquipmentBO convertToEquipmentBO() {
        EquipmentBO equipmentBO = new EquipmentBO();
        equipmentBO.setEquipmentId(this.getEquipmentId());
        equipmentBO.setManufacturerId(this.getManufacturerId());
        if (StrUtil.isNotEmpty(this.getDtuQueryType())) {
            if ("eq".equals(this.getDtuQueryType())) {
                equipmentBO.setEqDtuId(this.getDtuId());
            }
            if ("like".equals(this.getDtuQueryType())) {
                equipmentBO.setLikeDtuId(this.getDtuId());
            }
        }
        return equipmentBO;
    }

}
